<!-- 分类管理 -->
<template>
    <div class="page-box h100 display-flex czbj">
        <p class="title-label mb10">
            分类管理
        </p>
        <div>
            <dxtable :headBtn="headBtn" :dataJson="dataJson" :formJson="formJson" :portUrl="portUrl" :qx="qx" ref="databale" 
              ></dxtable>
        </div>


        <n-modal v-model:show="showModal" preset="card" class="Stock-diagnosis">
            <template #header>
                <div>浏览视频</div>
            </template>
            <div class="">
                <videoplay :url="videourl"></videoplay>
            </div>
            <template #action>
                <div class="tr">
                    <n-button @click="showModal = false"> 关闭 </n-button>
                </div>
            </template>
        </n-modal>
    </div>
</template>
<script lang='ts' setup>
import dxtable from "../../components/util/dxtable.vue";
import sort from "../../components/util/sort.vue";
import { dxget, dxpost, qurl, hf } from "../../util/index";
import videoplay from "./videoplay.vue"
import { h, ref, reactive } from "vue";
const props = defineProps({
    pup: { type: String },
});
const showModal = ref()
const videourl  = ref()
let headBtn = [];
const zdList = ref()
const databale = ref();
const initeer = () => {
    databale.value.initDataExpose();
};
const emit = defineEmits(["callBack"]);
// 弹窗公用该列表
let dataJson = reactive([
{
        title: "id",
        key: "id",
        width:50,
    }, {
        title: "分类名称",
        key: "title",
        width:200,
        search: true, // 是否在搜索栏展示
    },
    {
        title: "副标题",
        key: "subheading",
        width:200,
    }, {
        title: "视频介绍",
        key: "videoIntroduction",
        width:100,
        render(row){
            return h('span',{class:"ls sz", onClick: () => {
                    showModal.value = true
                    videourl.value = row.videoIntroduction
                }},'浏览视频')
        }
    }, {
        title: "简介",
        key: "briefIntroduction",
        ellipsis: {
            tooltip: true
        }
    },
  
    {
        title: "排序",
        width: 100,
        render(row) {
            row.databaseName = "xjyxsortManagement";
            return h(sort, {
                row,
                onCallBack: () => {
                    initeer();
                },
            });
        },
    },
    {
        title: "添加时间",
        key: "addTime",
        width: "140",
        type: "daterange",
    },
]);
let portUrl = "xjyx/xjyxsortManagement";
const qx = {
    DeletePermissionID: "xjyxsortManagementdel", //删除
    EditPermissionIdentifier: "xjyxsortManagementbj", // 编辑
    NewPermissionIdentifier: "xjyxsortManagementxz", // 新建
    ViewPermissionID: "xjyxsortManagementck", // 查看
};

let formJson = reactive([

    {
        title: "分类名称",
        key: "title",
        type: "input",
        required: true,
    },
    {
        title: "副标题",
        key: "subheading",
        type: "input"
    },{
        title: "视频介绍",
        key: "videoIntroduction",
        type: "video"
    }, {
        title: "简介",
        key: "briefIntroduction",
        type: "textarea"
    },
])


</script>
  
  
  